<template>
  <div class="mainContent">
    <div class="contentLeft">
      <div class="mapBox">
        <div class="areaBox scroll">
          <div
            v-for="item in monitorAreaList"
            :key="item.id"
            :class="['area', monitorAreaId === item.id && 'areaActive']"
            @click="monitorAreaChange(item.id)"
          >
            {{ item.name }}
          </div>
        </div>

        <MapShow class="map" />
      </div>

      <div class="monitorNum">
        <div v-for="item in monitorNumList" :key="item.id" class="numBox">
          <img class="icon" :src="item.icon" />

          <div class="numData">
            <div class="name">{{ item.name }}</div>

            <div class="num">{{ item.num }}<span class="unit">个</span></div>
          </div>
        </div>
      </div>
    </div>

    <div class="contentRight">
      <div class="monitor">
        <div class="title">监控视频</div>

        <div class="videoBox">
          <video src="https://assets.honqun.cn/video/v6.mp4" controls="controls" class="video">
            您的浏览器不支持 video 标签。
          </video>
        </div>
      </div>

      <div class="chartsTable">
        <div class="chartsBox">
          <siteMonitoring class="charts" />

          <RuralMonitoring class="charts" />
        </div>

        <ReturnShow class="table scroll" />
      </div>
    </div>
  </div>
</template>

<script setup>
import ReturnShow from './components/ReturnShow.vue'
import siteMonitoring from './components/siteMonitoring.vue'
import RuralMonitoring from './components/RuralMonitoring.vue'
import MapShow from './components/MapShow.vue'
import icon1 from '@/assets/community/icon1.png'
import icon2 from '@/assets/community/icon2.png'
import icon3 from '@/assets/community/icon3.png'
import { reactive, ref } from 'vue'

// 地点数量
const monitorAreaList = reactive([
    {
      id: 1,
      name: '方舱医院',
    },
    {
      id: 2,
      name: '隔离点',
    },
    {
      id: 3,
      name: '高速口',
    },
    {
      id: 4,
      name: '医学观察点',
    },
    {
      id: 5,
      name: '重点医院',
    },
    {
      id: 6,
      name: '乡镇监控',
    },
    {
      id: 7,
      name: '村（社区）监控',
    },
    {
      id: 8,
      name: '固墙卡点',
    },
    {
      id: 9,
      name: '黄寨卡点',
    },
    {
      id: 10,
      name: '大武卡点',
    },
    {
      id: 11,
      name: '郝岗卡点',
    },
    {
      id: 12,
      name: '谭庄卡点',
    },
  ]),
  monitorAreaId = ref(1),
  // 监控数量
  monitorNumList = reactive([
    {
      id: 1,
      name: '城乡社区监控',
      num: 28,
      icon: icon1,
    },
    {
      id: 2,
      name: '重点场所监控',
      num: 15,
      icon: icon2,
    },
    {
      id: 3,
      name: '卡口监控',
      num: 23,
      icon: icon3,
    },
  ])

// 监控地点改变
function monitorAreaChange(id) {
  monitorAreaId.value = id
}
</script>

<style lang="less" scoped>
.mainContent {
  display: flex;
  .contentLeft {
    flex: 1;

    .mapBox {
      height: 750px;
      display: flex;
      padding: 32px 24px;
      background-image: url('@/assets/community/boxbg1.png');
      background-repeat: no-repeat;
      background-size: 100% 100%;
      overflow: hidden;

      .areaBox {
        min-width: 116px;
        height: 100%;
        overflow: hidden auto;

        .area {
          width: 116px;
          height: 48px;
          background: rgba(0, 152, 221, 0.3);
          border-radius: 4px;
          font-size: 14px;
          font-weight: 400;
          color: #ffffff;
          display: flex;
          justify-content: center;
          align-items: center;
          cursor: pointer;

          &:not(:first-child) {
            margin-top: 16px;
          }

          &.areaActive {
            background: #0098dd;
            font-weight: 600;
          }
        }
      }

      .map {
        flex: 1;
      }
    }

    .monitorNum {
      margin-top: 16px;
      padding-left: 149px;
      height: 113px;
      background: rgba(19, 181, 177, 0.2);
      display: flex;
      justify-content: center;
      align-items: center;

      .numBox {
        flex: 1;
        display: flex;
        align-items: center;

        .icon {
          width: 50px;
          height: 50px;
        }

        .numData {
          flex: 1;
          align-items: center;
          margin-left: 7px;

          .name {
            height: 20px;
            font-size: 14px;
            color: #ffffff;
            display: flex;
            align-items: center;
          }

          .num {
            margin-top: 7px;
            height: 29px;
            font-size: 24px;
            font-weight: bold;
            font-family: Tahoma-Bold, Tahoma;
            color: #ffffff;
            line-height: 1;
            background: linear-gradient(180deg, #64cdab 0%, #49d0ff 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;

            .unit {
              margin-left: 4px;
              font-size: 14px;
              color: #ffffff;
              background: #ffffff;
              -webkit-background-clip: text;
              -webkit-text-fill-color: transparent;
            }
          }
        }
      }
    }
  }

  .contentRight {
    margin-left: 16px;

    .monitor {
      width: 696px;
      height: 381px;
      background-image: url('@/assets/community/boxbg2.png');
      background-repeat: no-repeat;
      background-size: 100% 100%;
      display: flex;
      flex-direction: column;
      overflow: hidden;

      .title {
        margin-top: 8px;
        width: 100%;
        height: 20px;
        font-size: 14px;
        color: #ffffff;
        display: flex;
        justify-content: center;
        align-items: center;
      }

      .videoBox {
        flex: 1;
        margin: 11px 13px 21px 17px;
        display: flex;
        overflow: hidden;

        .video {
          width: 100%;
          height: 100%;
          background: #04064c;
        }
      }
    }

    .chartsTable {
      display: flex;
      margin-top: 16px;

      .chartsBox {
        display: flex;
        flex-direction: column;

        .charts {
          &:not(:first-child) {
            margin-top: 16px;
          }
        }
      }

      .table {
        margin-left: 16px;
      }
    }
  }
}
.cantor {
  display: flex;
  .KeySites {
    width: 197px;
    padding-bottom: 8px;
    margin-bottom: 1rem;
    background: url('./components/img/divbg.png') no-repeat;
    background-size: 100% 100%;

    .title {
      display: flex;
      padding-top: 5px;
      margin-left: 1rem;
      margin-bottom: 6px;
      align-items: center;
      .title_span {
        margin-right: 0.8rem;
        font-size: 14px;
        font-family: Source Han Sans CN, serif;
        font-weight: bold;
        line-height: 28px;
        color: #10f3fc;
      }
    }
    .item_button {
      width: 171px;
      height: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 13px;
      font-family: Source Han Sans CN, serif;
      //font-weight: bold;
      //color: #45E8FA;
      color: rgba(255, 255, 255, 0.66);
      opacity: 1;
      //letter-spacing: 30px;
      background: url('./components/img/hospital.png') no-repeat;
      background-size: 100% 100%;
    }
    .item_button_bottom {
      width: 100%;
      height: 6px;
      background: url('./components/img/bottom.png') no-repeat;
      background-size: 100% 100%;
    }
  }
  .item_button_active {
    font-size: 13px;
    font-family: Source Han Sans CN, serif;
    font-weight: bold !important;
    color: #45e8fa !important;
  }
  /*.item_button_active:after{
    content: "";    width: 0;
    height: 0;
    position: relative;
    top: 0px;
    left: 4rem;
    border-top:solid 5px transparent;

    border-right:solid 15px black ;

    border-bottom:solid 5px transparent;
  }*/
  .right_div {
    width: 407px;
    margin-bottom: 23px;
    background: url('./components/img/right_div_bg.png') no-repeat;
    background-size: 100% 100%;
    .right_div_title {
      font-size: 14px;
      height: 27px;
      padding: 5px;
      font-family: SourceHanSansCN-Medium, serif;
      line-height: 27px;
      color: #ffffff;
    }
  }
}
.bottom {
  width: 100%;
  height: 140px;
  display: flex;
  justify-content: center;
  column-gap: 10rem;
  background: url('./components/img/bottom_bg.png') no-repeat;
  background-size: 100% 100%;
  .bottom_item {
    width: 110px;
    height: 140px;
    font-size: 18px;
    font-family: Source Han Sans CN, serif;
    font-weight: 500;
    line-height: 40px;
    color: #ffffff;
    background: url('./components/img/bottom_item_button.png') no-repeat;
    background-size: 100% 100%;
    .bottom_item_span {
      font-size: 16px;
      margin-top: 1.2rem;
      font-family: Source Han Sans CN, serif;
      font-weight: 400;
      line-height: 24px;
      color: #ffffff;
    }
    .bottom_item_number {
      color: #ffba77;
      font-size: 26px;
    }
  }
}
.dialog {
  width: 484px;
  height: 354px;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 180px;
  right: 480px;
  background: url('./components/img/dialog.png') no-repeat;
  background-size: 100% 100%;
  .video_bottom {
    display: flex;
    align-items: center;
    column-gap: 1rem;
    font-size: 14px;
    font-family: Source Han Sans CN, serif;
    font-weight: 500;
    line-height: 31px;
    color: #ffffff;
    .video_bottom_num {
      font-size: 22px;
      font-family: Source Han Sans CN, serif;
      font-weight: 500;
      line-height: 31px;
      color: #37fac6;
    }
  }
}
.left-triangle {
  width: 0px;
  height: 0px;
  position: relative;
  border-right: 10px solid #000;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
</style>
